using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VWTWASTE
    {
        public DataRow Convert2WTWASTE(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryWTWASTE(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["WTAMANDANT"] = " ".PadRight(2 ); 
         dwReturn["WTANUMB"] = " ".PadRight(8 ); 
         dwReturn["WTAAENZL"] = " ".PadRight(0 ); 
         dwReturn["WTAAENB"] = " ".PadRight(8 ); 
         dwReturn["WTAAEND"] = " ".PadRight(0 ); 
         dwReturn["WTANEUB"] = " ".PadRight(8 ); 
         dwReturn["WTANEUD"] = " ".PadRight(0 ); 
         dwReturn["WTABEZ"] = " ".PadRight(50 ); 
         dwReturn["WTASTA"] = " ".PadRight(1 ); 
         dwReturn["WTAPRIO"] = " ".PadRight(2 ); 
         dwReturn["WTALEVEL"] = " ".PadRight(1 ); 
         dwReturn["WTAEND"] = " ".PadRight(1 ); 
         dwReturn["WTADEMLEV"] = " ".PadRight(1 ); 
         dwReturn["WTAPROLEV"] = " ".PadRight(1 ); 
         dwReturn["WTAMDORD"] = " ".PadRight(1 ); 
         dwReturn["WTAWEFT"] = " ".PadRight(1 ); 
         dwReturn["WTAAUFART1"] = " ".PadRight(2 ); 
         dwReturn["WTAAUFART2"] = " ".PadRight(2 ); 
         dwReturn["WTAAUFART3"] = " ".PadRight(2 ); 
         dwReturn["WTAPOSTYP1"] = " ".PadRight(3 ); 
         dwReturn["WTAPOSTYP2"] = " ".PadRight(3 ); 
         dwReturn["WTAPOSTYP3"] = " ".PadRight(3 ); 
         dwReturn["WTAPOSTYP4"] = " ".PadRight(3 ); 
         dwReturn["WTAPOSTYP5"] = " ".PadRight(3 ); 
         dwReturn["WTAPOSTYP6"] = " ".PadRight(3 ); 
         dwReturn["WTASRFNR"] = " ".PadRight(15 ); 
         dwReturn["WTASRFNRNO"] = " ".PadRight(1 ); 
         dwReturn["WTASFLGNR"] = " ".PadRight(15 ); 
         dwReturn["WTASFLGNRNO"] = " ".PadRight(1 ); 
         dwReturn["WTABIND"] = " ".PadRight(15 ); 
         dwReturn["WTABINDNO"] = " ".PadRight(1 ); 
         dwReturn["WTABAUMKZ"] = " ".PadRight(1 ); 
         dwReturn["WTAVERWEN"] = " ".PadRight(1 ); 
         dwReturn["WTAPSCHT"] = " ".PadRight(2 ); 
         dwReturn["WTAPGSCHT"] = " ".PadRight(2 ); 
         dwReturn["WTARAVGRPO"] = " ".PadRight(4 ); 
         dwReturn["WTARAVGRPD"] = " ".PadRight(4 ); 
         dwReturn["WTASUBSTGRO"] = " ".PadRight(3 ); 
         dwReturn["WTASUBSTGRD"] = " ".PadRight(3 ); 
         dwReturn["WTAHANDICO"] = " ".PadRight(3 ); 
         dwReturn["WTAHANDICD"] = " ".PadRight(3 ); 
         dwReturn["WTAPROGRPO"] = " ".PadRight(3 ); 
         dwReturn["WTAPROGRPD"] = " ".PadRight(3 ); 
         dwReturn["WTAARTGRPO"] = " ".PadRight(3 ); 
         dwReturn["WTAARTGRPD"] = " ".PadRight(3 ); 
         dwReturn["WTAAUFKZO"] = " ".PadRight(1 ); 
         dwReturn["WTAAUFKZD"] = " ".PadRight(1 ); 
         dwReturn["WTAMATKLO"] = " ".PadRight(9 ); 
         dwReturn["WTAMATKLD"] = " ".PadRight(9 ); 
         dwReturn["WTAMAT"] = " ".PadRight(6 ); 
         dwReturn["WTATYP"] = " ".PadRight(3 ); 
         dwReturn["WTARKL"] = " ".PadRight(4 ); 
         dwReturn["WTAWAART"] = " ".PadRight(3 ); 
         dwReturn["WTAMTYP"] = " ".PadRight(8 ); 
         dwReturn["WTACHORE"] = " ".PadRight(1 ); 
         dwReturn["WTAAUFMSL"] = " ".PadRight(2 ); 
         dwReturn["WTAEFFECT"] = " ".PadRight(3 ); 
         dwReturn["WTASPINPRO"] = " ".PadRight(3 ); 
         dwReturn["WTAPRODPRO"] = " ".PadRight(3 ); 
         dwReturn["WTAFIBPREP"] = " ".PadRight(1 ); 
         dwReturn["WTAFERTKZ1"] = " ".PadRight(1 ); 
         dwReturn["WTAFERTKZ2"] = " ".PadRight(1 ); 
         dwReturn["WTASFKZ"] = " ".PadRight(1 ); 
         dwReturn["WTAFDVF"] = " ".PadRight(3 ); 
         dwReturn["WTARUESTGRP"] = " ".PadRight(3 ); 
         dwReturn["WTABOM"] = " ".PadRight(1 ); 
         dwReturn["WTABOMCGRP"] = " ".PadRight(1 ); 
         dwReturn["WTASTATVF"] = " ".PadRight(3 ); 
         dwReturn["WTARECHNUM"] = " ".PadRight(4 ); 
         dwReturn["WTARECHNRV"] = " ".PadRight(0 ); 
         dwReturn["WTARECHNRB"] = " ".PadRight(0 ); 
         dwReturn["WTAFACHV"] = " ".PadRight(2 ); 
         dwReturn["WTAFACHB"] = " ".PadRight(2 ); 
         dwReturn["WTACNTEXV"] = " ".PadRight(0 ); 
         dwReturn["WTACNTEXB"] = " ".PadRight(0 ); 
         dwReturn["WTATOMEV"] = " ".PadRight(0 ); 
         dwReturn["WTATOMEB"] = " ".PadRight(0 ); 
         dwReturn["WTARWBRTV"] = " ".PadRight(0 ); 
         dwReturn["WTARWBRTB"] = " ".PadRight(0 ); 
         dwReturn["WTARGRQMV"] = " ".PadRight(0 ); 
         dwReturn["WTARGRQMB"] = " ".PadRight(0 ); 
         dwReturn["WTAAUFMEV"] = " ".PadRight(0 ); 
         dwReturn["WTAAUFMEB"] = " ".PadRight(0 ); 
         dwReturn["WTAAUFMEEH"] = " ".PadRight(1 ); 
         dwReturn["WTALAEV"] = " ".PadRight(0 ); 
         dwReturn["WTALAEB"] = " ".PadRight(0 ); 
         dwReturn["WTAPROZFDZV"] = " ".PadRight(0 ); 
         dwReturn["WTAPROZFDZB"] = " ".PadRight(0 ); 
         dwReturn["WTABEDARFV"] = " ".PadRight(0 ); 
         dwReturn["WTABEDARFB"] = " ".PadRight(0 ); 
         dwReturn["WTADSPULGV"] = " ".PadRight(0 ); 
         dwReturn["WTADSPULGB"] = " ".PadRight(0 ); 
         dwReturn["WTAFARBE1"] = " ".PadRight(10 ); 
         dwReturn["WTAFARBENO1"] = " ".PadRight(1 ); 
         dwReturn["WTAFARBE2"] = " ".PadRight(10 ); 
         dwReturn["WTAFARBENO2"] = " ".PadRight(1 ); 
         dwReturn["WTAFARBE3"] = " ".PadRight(10 ); 
         dwReturn["WTAFARBENO3"] = " ".PadRight(1 ); 
         dwReturn["WTAFARBGRP1"] = " ".PadRight(1 ); 
         dwReturn["WTAFARBGRP2"] = " ".PadRight(1 ); 
         dwReturn["WTAFARBGRP3"] = " ".PadRight(1 ); 
         dwReturn["WTATREATM"] = " ".PadRight(3 ); 
         dwReturn["WTAWASTE"] = " ".PadRight(0 ); 
         dwReturn["WTAADLGTH"] = " ".PadRight(0 ); 
         dwReturn["WTAADLGTHM"] = " ".PadRight(1 ); 
         dwReturn["WTAADQTY"] = " ".PadRight(0 ); 
         dwReturn["WTAADQTYM"] = " ".PadRight(1 ); 
         dwReturn["WTAWEAVIN"] = " ".PadRight(0 ); 
         dwReturn["WTAWEFTLG"] = " ".PadRight(0 ); 
         dwReturn["WTAWARPLG"] = " ".PadRight(0 ); 
         dwReturn["WTARPM"] = " ".PadRight(0 ); 
         dwReturn["WTAMAEFCY"] = " ".PadRight(0 ); 
         dwReturn["WTAWEEFCY"] = " ".PadRight(0 ); 
         dwReturn["WTATIME"] = " ".PadRight(0 ); 
         dwReturn["WTAFILLER"] = " ".PadRight(80 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapWTWASTE(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveWTWASTE(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryWTWASTE(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapWTWASTE(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertWTWASTE(dwLocal, ITXDBVERSION);
            }
            UpdateWTWASTE(dwLocal);
        }
        public void InsertWTWASTE(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO WTWASTE(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryWTWASTE(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM WTWASTE WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM WTWASTE  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "WTWASTE";
            Return = Result;
            return Return;
        }
        public void DeleteWTWASTE(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM WTWASTE   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateWTWASTE(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE WTWASTE SET "
                    +"WTAMANDANT= :WTAMANDANT,"
                    +"WTANUMB= :WTANUMB,"
                    +"WTAAENZL= :WTAAENZL,"
                    +"WTAAENB= :WTAAENB,"
                    +"WTAAEND= :WTAAEND,"
                    +"WTANEUB= :WTANEUB,"
                    +"WTANEUD= :WTANEUD,"
                    +"WTABEZ= :WTABEZ,"
                    +"WTASTA= :WTASTA,"
                    +"WTAPRIO= :WTAPRIO,"
                    +"WTALEVEL= :WTALEVEL,"
                    +"WTAEND= :WTAEND,"
                    +"WTADEMLEV= :WTADEMLEV,"
                    +"WTAPROLEV= :WTAPROLEV,"
                    +"WTAMDORD= :WTAMDORD,"
                    +"WTAWEFT= :WTAWEFT,"
                    +"WTAAUFART1= :WTAAUFART1,"
                    +"WTAAUFART2= :WTAAUFART2,"
                    +"WTAAUFART3= :WTAAUFART3,"
                    +"WTAPOSTYP1= :WTAPOSTYP1,"
                    +"WTAPOSTYP2= :WTAPOSTYP2,"
                    +"WTAPOSTYP3= :WTAPOSTYP3,"
                    +"WTAPOSTYP4= :WTAPOSTYP4,"
                    +"WTAPOSTYP5= :WTAPOSTYP5,"
                    +"WTAPOSTYP6= :WTAPOSTYP6,"
                    +"WTASRFNR= :WTASRFNR,"
                    +"WTASRFNRNO= :WTASRFNRNO,"
                    +"WTASFLGNR= :WTASFLGNR,"
                    +"WTASFLGNRNO= :WTASFLGNRNO,"
                    +"WTABIND= :WTABIND,"
                    +"WTABINDNO= :WTABINDNO,"
                    +"WTABAUMKZ= :WTABAUMKZ,"
                    +"WTAVERWEN= :WTAVERWEN,"
                    +"WTAPSCHT= :WTAPSCHT,"
                    +"WTAPGSCHT= :WTAPGSCHT,"
                    +"WTARAVGRPO= :WTARAVGRPO,"
                    +"WTARAVGRPD= :WTARAVGRPD,"
                    +"WTASUBSTGRO= :WTASUBSTGRO,"
                    +"WTASUBSTGRD= :WTASUBSTGRD,"
                    +"WTAHANDICO= :WTAHANDICO,"
                    +"WTAHANDICD= :WTAHANDICD,"
                    +"WTAPROGRPO= :WTAPROGRPO,"
                    +"WTAPROGRPD= :WTAPROGRPD,"
                    +"WTAARTGRPO= :WTAARTGRPO,"
                    +"WTAARTGRPD= :WTAARTGRPD,"
                    +"WTAAUFKZO= :WTAAUFKZO,"
                    +"WTAAUFKZD= :WTAAUFKZD,"
                    +"WTAMATKLO= :WTAMATKLO,"
                    +"WTAMATKLD= :WTAMATKLD,"
                    +"WTAMAT= :WTAMAT,"
                    +"WTATYP= :WTATYP,"
                    +"WTARKL= :WTARKL,"
                    +"WTAWAART= :WTAWAART,"
                    +"WTAMTYP= :WTAMTYP,"
                    +"WTACHORE= :WTACHORE,"
                    +"WTAAUFMSL= :WTAAUFMSL,"
                    +"WTAEFFECT= :WTAEFFECT,"
                    +"WTASPINPRO= :WTASPINPRO,"
                    +"WTAPRODPRO= :WTAPRODPRO,"
                    +"WTAFIBPREP= :WTAFIBPREP,"
                    +"WTAFERTKZ1= :WTAFERTKZ1,"
                    +"WTAFERTKZ2= :WTAFERTKZ2,"
                    +"WTASFKZ= :WTASFKZ,"
                    +"WTAFDVF= :WTAFDVF,"
                    +"WTARUESTGRP= :WTARUESTGRP,"
                    +"WTABOM= :WTABOM,"
                    +"WTABOMCGRP= :WTABOMCGRP,"
                    +"WTASTATVF= :WTASTATVF,"
                    +"WTARECHNUM= :WTARECHNUM,"
                    +"WTARECHNRV= :WTARECHNRV,"
                    +"WTARECHNRB= :WTARECHNRB,"
                    +"WTAFACHV= :WTAFACHV,"
                    +"WTAFACHB= :WTAFACHB,"
                    +"WTACNTEXV= :WTACNTEXV,"
                    +"WTACNTEXB= :WTACNTEXB,"
                    +"WTATOMEV= :WTATOMEV,"
                    +"WTATOMEB= :WTATOMEB,"
                    +"WTARWBRTV= :WTARWBRTV,"
                    +"WTARWBRTB= :WTARWBRTB,"
                    +"WTARGRQMV= :WTARGRQMV,"
                    +"WTARGRQMB= :WTARGRQMB,"
                    +"WTAAUFMEV= :WTAAUFMEV,"
                    +"WTAAUFMEB= :WTAAUFMEB,"
                    +"WTAAUFMEEH= :WTAAUFMEEH,"
                    +"WTALAEV= :WTALAEV,"
                    +"WTALAEB= :WTALAEB,"
                    +"WTAPROZFDZV= :WTAPROZFDZV,"
                    +"WTAPROZFDZB= :WTAPROZFDZB,"
                    +"WTABEDARFV= :WTABEDARFV,"
                    +"WTABEDARFB= :WTABEDARFB,"
                    +"WTADSPULGV= :WTADSPULGV,"
                    +"WTADSPULGB= :WTADSPULGB,"
                    +"WTAFARBE1= :WTAFARBE1,"
                    +"WTAFARBENO1= :WTAFARBENO1,"
                    +"WTAFARBE2= :WTAFARBE2,"
                    +"WTAFARBENO2= :WTAFARBENO2,"
                    +"WTAFARBE3= :WTAFARBE3,"
                    +"WTAFARBENO3= :WTAFARBENO3,"
                    +"WTAFARBGRP1= :WTAFARBGRP1,"
                    +"WTAFARBGRP2= :WTAFARBGRP2,"
                    +"WTAFARBGRP3= :WTAFARBGRP3,"
                    +"WTATREATM= :WTATREATM,"
                    +"WTAWASTE= :WTAWASTE,"
                    +"WTAADLGTH= :WTAADLGTH,"
                    +"WTAADLGTHM= :WTAADLGTHM,"
                    +"WTAADQTY= :WTAADQTY,"
                    +"WTAADQTYM= :WTAADQTYM,"
                    +"WTAWEAVIN= :WTAWEAVIN,"
                    +"WTAWEFTLG= :WTAWEFTLG,"
                    +"WTAWARPLG= :WTAWARPLG,"
                    +"WTARPM= :WTARPM,"
                    +"WTAMAEFCY= :WTAMAEFCY,"
                    +"WTAWEEFCY= :WTAWEEFCY,"
                    +"WTATIME= :WTATIME,"
                    +"WTAFILLER= :WTAFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("WTAMANDANT", OracleType.NVarChar).Value = dwData["WTAMANDANT"].ToString(); 
          or1.Parameters.Add("WTANUMB", OracleType.NVarChar).Value = dwData["WTANUMB"].ToString(); 
          or1.Parameters.Add("WTAAENZL", OracleType.NVarChar).Value = dwData["WTAAENZL"].ToString(); 
          or1.Parameters.Add("WTAAENB", OracleType.NVarChar).Value = dwData["WTAAENB"].ToString(); 
          or1.Parameters.Add("WTAAEND", OracleType.NVarChar).Value = dwData["WTAAEND"].ToString(); 
          or1.Parameters.Add("WTANEUB", OracleType.NVarChar).Value = dwData["WTANEUB"].ToString(); 
          or1.Parameters.Add("WTANEUD", OracleType.NVarChar).Value = dwData["WTANEUD"].ToString(); 
          or1.Parameters.Add("WTABEZ", OracleType.NVarChar).Value = dwData["WTABEZ"].ToString(); 
          or1.Parameters.Add("WTASTA", OracleType.NVarChar).Value = dwData["WTASTA"].ToString(); 
          or1.Parameters.Add("WTAPRIO", OracleType.NVarChar).Value = dwData["WTAPRIO"].ToString(); 
          or1.Parameters.Add("WTALEVEL", OracleType.NVarChar).Value = dwData["WTALEVEL"].ToString(); 
          or1.Parameters.Add("WTAEND", OracleType.NVarChar).Value = dwData["WTAEND"].ToString(); 
          or1.Parameters.Add("WTADEMLEV", OracleType.NVarChar).Value = dwData["WTADEMLEV"].ToString(); 
          or1.Parameters.Add("WTAPROLEV", OracleType.NVarChar).Value = dwData["WTAPROLEV"].ToString(); 
          or1.Parameters.Add("WTAMDORD", OracleType.NVarChar).Value = dwData["WTAMDORD"].ToString(); 
          or1.Parameters.Add("WTAWEFT", OracleType.NVarChar).Value = dwData["WTAWEFT"].ToString(); 
          or1.Parameters.Add("WTAAUFART1", OracleType.NVarChar).Value = dwData["WTAAUFART1"].ToString(); 
          or1.Parameters.Add("WTAAUFART2", OracleType.NVarChar).Value = dwData["WTAAUFART2"].ToString(); 
          or1.Parameters.Add("WTAAUFART3", OracleType.NVarChar).Value = dwData["WTAAUFART3"].ToString(); 
          or1.Parameters.Add("WTAPOSTYP1", OracleType.NVarChar).Value = dwData["WTAPOSTYP1"].ToString(); 
          or1.Parameters.Add("WTAPOSTYP2", OracleType.NVarChar).Value = dwData["WTAPOSTYP2"].ToString(); 
          or1.Parameters.Add("WTAPOSTYP3", OracleType.NVarChar).Value = dwData["WTAPOSTYP3"].ToString(); 
          or1.Parameters.Add("WTAPOSTYP4", OracleType.NVarChar).Value = dwData["WTAPOSTYP4"].ToString(); 
          or1.Parameters.Add("WTAPOSTYP5", OracleType.NVarChar).Value = dwData["WTAPOSTYP5"].ToString(); 
          or1.Parameters.Add("WTAPOSTYP6", OracleType.NVarChar).Value = dwData["WTAPOSTYP6"].ToString(); 
          or1.Parameters.Add("WTASRFNR", OracleType.NVarChar).Value = dwData["WTASRFNR"].ToString(); 
          or1.Parameters.Add("WTASRFNRNO", OracleType.NVarChar).Value = dwData["WTASRFNRNO"].ToString(); 
          or1.Parameters.Add("WTASFLGNR", OracleType.NVarChar).Value = dwData["WTASFLGNR"].ToString(); 
          or1.Parameters.Add("WTASFLGNRNO", OracleType.NVarChar).Value = dwData["WTASFLGNRNO"].ToString(); 
          or1.Parameters.Add("WTABIND", OracleType.NVarChar).Value = dwData["WTABIND"].ToString(); 
          or1.Parameters.Add("WTABINDNO", OracleType.NVarChar).Value = dwData["WTABINDNO"].ToString(); 
          or1.Parameters.Add("WTABAUMKZ", OracleType.NVarChar).Value = dwData["WTABAUMKZ"].ToString(); 
          or1.Parameters.Add("WTAVERWEN", OracleType.NVarChar).Value = dwData["WTAVERWEN"].ToString(); 
          or1.Parameters.Add("WTAPSCHT", OracleType.NVarChar).Value = dwData["WTAPSCHT"].ToString(); 
          or1.Parameters.Add("WTAPGSCHT", OracleType.NVarChar).Value = dwData["WTAPGSCHT"].ToString(); 
          or1.Parameters.Add("WTARAVGRPO", OracleType.NVarChar).Value = dwData["WTARAVGRPO"].ToString(); 
          or1.Parameters.Add("WTARAVGRPD", OracleType.NVarChar).Value = dwData["WTARAVGRPD"].ToString(); 
          or1.Parameters.Add("WTASUBSTGRO", OracleType.NVarChar).Value = dwData["WTASUBSTGRO"].ToString(); 
          or1.Parameters.Add("WTASUBSTGRD", OracleType.NVarChar).Value = dwData["WTASUBSTGRD"].ToString(); 
          or1.Parameters.Add("WTAHANDICO", OracleType.NVarChar).Value = dwData["WTAHANDICO"].ToString(); 
          or1.Parameters.Add("WTAHANDICD", OracleType.NVarChar).Value = dwData["WTAHANDICD"].ToString(); 
          or1.Parameters.Add("WTAPROGRPO", OracleType.NVarChar).Value = dwData["WTAPROGRPO"].ToString(); 
          or1.Parameters.Add("WTAPROGRPD", OracleType.NVarChar).Value = dwData["WTAPROGRPD"].ToString(); 
          or1.Parameters.Add("WTAARTGRPO", OracleType.NVarChar).Value = dwData["WTAARTGRPO"].ToString(); 
          or1.Parameters.Add("WTAARTGRPD", OracleType.NVarChar).Value = dwData["WTAARTGRPD"].ToString(); 
          or1.Parameters.Add("WTAAUFKZO", OracleType.NVarChar).Value = dwData["WTAAUFKZO"].ToString(); 
          or1.Parameters.Add("WTAAUFKZD", OracleType.NVarChar).Value = dwData["WTAAUFKZD"].ToString(); 
          or1.Parameters.Add("WTAMATKLO", OracleType.NVarChar).Value = dwData["WTAMATKLO"].ToString(); 
          or1.Parameters.Add("WTAMATKLD", OracleType.NVarChar).Value = dwData["WTAMATKLD"].ToString(); 
          or1.Parameters.Add("WTAMAT", OracleType.NVarChar).Value = dwData["WTAMAT"].ToString(); 
          or1.Parameters.Add("WTATYP", OracleType.NVarChar).Value = dwData["WTATYP"].ToString(); 
          or1.Parameters.Add("WTARKL", OracleType.NVarChar).Value = dwData["WTARKL"].ToString(); 
          or1.Parameters.Add("WTAWAART", OracleType.NVarChar).Value = dwData["WTAWAART"].ToString(); 
          or1.Parameters.Add("WTAMTYP", OracleType.NVarChar).Value = dwData["WTAMTYP"].ToString(); 
          or1.Parameters.Add("WTACHORE", OracleType.NVarChar).Value = dwData["WTACHORE"].ToString(); 
          or1.Parameters.Add("WTAAUFMSL", OracleType.NVarChar).Value = dwData["WTAAUFMSL"].ToString(); 
          or1.Parameters.Add("WTAEFFECT", OracleType.NVarChar).Value = dwData["WTAEFFECT"].ToString(); 
          or1.Parameters.Add("WTASPINPRO", OracleType.NVarChar).Value = dwData["WTASPINPRO"].ToString(); 
          or1.Parameters.Add("WTAPRODPRO", OracleType.NVarChar).Value = dwData["WTAPRODPRO"].ToString(); 
          or1.Parameters.Add("WTAFIBPREP", OracleType.NVarChar).Value = dwData["WTAFIBPREP"].ToString(); 
          or1.Parameters.Add("WTAFERTKZ1", OracleType.NVarChar).Value = dwData["WTAFERTKZ1"].ToString(); 
          or1.Parameters.Add("WTAFERTKZ2", OracleType.NVarChar).Value = dwData["WTAFERTKZ2"].ToString(); 
          or1.Parameters.Add("WTASFKZ", OracleType.NVarChar).Value = dwData["WTASFKZ"].ToString(); 
          or1.Parameters.Add("WTAFDVF", OracleType.NVarChar).Value = dwData["WTAFDVF"].ToString(); 
          or1.Parameters.Add("WTARUESTGRP", OracleType.NVarChar).Value = dwData["WTARUESTGRP"].ToString(); 
          or1.Parameters.Add("WTABOM", OracleType.NVarChar).Value = dwData["WTABOM"].ToString(); 
          or1.Parameters.Add("WTABOMCGRP", OracleType.NVarChar).Value = dwData["WTABOMCGRP"].ToString(); 
          or1.Parameters.Add("WTASTATVF", OracleType.NVarChar).Value = dwData["WTASTATVF"].ToString(); 
          or1.Parameters.Add("WTARECHNUM", OracleType.NVarChar).Value = dwData["WTARECHNUM"].ToString(); 
          or1.Parameters.Add("WTARECHNRV", OracleType.NVarChar).Value = dwData["WTARECHNRV"].ToString(); 
          or1.Parameters.Add("WTARECHNRB", OracleType.NVarChar).Value = dwData["WTARECHNRB"].ToString(); 
          or1.Parameters.Add("WTAFACHV", OracleType.NVarChar).Value = dwData["WTAFACHV"].ToString(); 
          or1.Parameters.Add("WTAFACHB", OracleType.NVarChar).Value = dwData["WTAFACHB"].ToString(); 
          or1.Parameters.Add("WTACNTEXV", OracleType.NVarChar).Value = dwData["WTACNTEXV"].ToString(); 
          or1.Parameters.Add("WTACNTEXB", OracleType.NVarChar).Value = dwData["WTACNTEXB"].ToString(); 
          or1.Parameters.Add("WTATOMEV", OracleType.NVarChar).Value = dwData["WTATOMEV"].ToString(); 
          or1.Parameters.Add("WTATOMEB", OracleType.NVarChar).Value = dwData["WTATOMEB"].ToString(); 
          or1.Parameters.Add("WTARWBRTV", OracleType.NVarChar).Value = dwData["WTARWBRTV"].ToString(); 
          or1.Parameters.Add("WTARWBRTB", OracleType.NVarChar).Value = dwData["WTARWBRTB"].ToString(); 
          or1.Parameters.Add("WTARGRQMV", OracleType.NVarChar).Value = dwData["WTARGRQMV"].ToString(); 
          or1.Parameters.Add("WTARGRQMB", OracleType.NVarChar).Value = dwData["WTARGRQMB"].ToString(); 
          or1.Parameters.Add("WTAAUFMEV", OracleType.NVarChar).Value = dwData["WTAAUFMEV"].ToString(); 
          or1.Parameters.Add("WTAAUFMEB", OracleType.NVarChar).Value = dwData["WTAAUFMEB"].ToString(); 
          or1.Parameters.Add("WTAAUFMEEH", OracleType.NVarChar).Value = dwData["WTAAUFMEEH"].ToString(); 
          or1.Parameters.Add("WTALAEV", OracleType.NVarChar).Value = dwData["WTALAEV"].ToString(); 
          or1.Parameters.Add("WTALAEB", OracleType.NVarChar).Value = dwData["WTALAEB"].ToString(); 
          or1.Parameters.Add("WTAPROZFDZV", OracleType.NVarChar).Value = dwData["WTAPROZFDZV"].ToString(); 
          or1.Parameters.Add("WTAPROZFDZB", OracleType.NVarChar).Value = dwData["WTAPROZFDZB"].ToString(); 
          or1.Parameters.Add("WTABEDARFV", OracleType.NVarChar).Value = dwData["WTABEDARFV"].ToString(); 
          or1.Parameters.Add("WTABEDARFB", OracleType.NVarChar).Value = dwData["WTABEDARFB"].ToString(); 
          or1.Parameters.Add("WTADSPULGV", OracleType.NVarChar).Value = dwData["WTADSPULGV"].ToString(); 
          or1.Parameters.Add("WTADSPULGB", OracleType.NVarChar).Value = dwData["WTADSPULGB"].ToString(); 
          or1.Parameters.Add("WTAFARBE1", OracleType.NVarChar).Value = dwData["WTAFARBE1"].ToString(); 
          or1.Parameters.Add("WTAFARBENO1", OracleType.NVarChar).Value = dwData["WTAFARBENO1"].ToString(); 
          or1.Parameters.Add("WTAFARBE2", OracleType.NVarChar).Value = dwData["WTAFARBE2"].ToString(); 
          or1.Parameters.Add("WTAFARBENO2", OracleType.NVarChar).Value = dwData["WTAFARBENO2"].ToString(); 
          or1.Parameters.Add("WTAFARBE3", OracleType.NVarChar).Value = dwData["WTAFARBE3"].ToString(); 
          or1.Parameters.Add("WTAFARBENO3", OracleType.NVarChar).Value = dwData["WTAFARBENO3"].ToString(); 
          or1.Parameters.Add("WTAFARBGRP1", OracleType.NVarChar).Value = dwData["WTAFARBGRP1"].ToString(); 
          or1.Parameters.Add("WTAFARBGRP2", OracleType.NVarChar).Value = dwData["WTAFARBGRP2"].ToString(); 
          or1.Parameters.Add("WTAFARBGRP3", OracleType.NVarChar).Value = dwData["WTAFARBGRP3"].ToString(); 
          or1.Parameters.Add("WTATREATM", OracleType.NVarChar).Value = dwData["WTATREATM"].ToString(); 
          or1.Parameters.Add("WTAWASTE", OracleType.NVarChar).Value = dwData["WTAWASTE"].ToString(); 
          or1.Parameters.Add("WTAADLGTH", OracleType.NVarChar).Value = dwData["WTAADLGTH"].ToString(); 
          or1.Parameters.Add("WTAADLGTHM", OracleType.NVarChar).Value = dwData["WTAADLGTHM"].ToString(); 
          or1.Parameters.Add("WTAADQTY", OracleType.NVarChar).Value = dwData["WTAADQTY"].ToString(); 
          or1.Parameters.Add("WTAADQTYM", OracleType.NVarChar).Value = dwData["WTAADQTYM"].ToString(); 
          or1.Parameters.Add("WTAWEAVIN", OracleType.NVarChar).Value = dwData["WTAWEAVIN"].ToString(); 
          or1.Parameters.Add("WTAWEFTLG", OracleType.NVarChar).Value = dwData["WTAWEFTLG"].ToString(); 
          or1.Parameters.Add("WTAWARPLG", OracleType.NVarChar).Value = dwData["WTAWARPLG"].ToString(); 
          or1.Parameters.Add("WTARPM", OracleType.NVarChar).Value = dwData["WTARPM"].ToString(); 
          or1.Parameters.Add("WTAMAEFCY", OracleType.NVarChar).Value = dwData["WTAMAEFCY"].ToString(); 
          or1.Parameters.Add("WTAWEEFCY", OracleType.NVarChar).Value = dwData["WTAWEEFCY"].ToString(); 
          or1.Parameters.Add("WTATIME", OracleType.NVarChar).Value = dwData["WTATIME"].ToString(); 
          or1.Parameters.Add("WTAFILLER", OracleType.NVarChar).Value = dwData["WTAFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
